1 Public Class FrmPURCHASEORDER_RECEIVE
2
3     Private Sub FrmPURCHASEORDER_RECEIVE_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
4         MDIREFRESH()
5     End Sub
6
7     Private Sub FrmPURCHASEORDER_RECEIVE_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
8         sqlSTR =
"SELECT TBL_Purchase_Order.Purchase_ID as 'ID', TBL_Suppliers.SuppName as 'Supplier Name' " & _
9                  
", TBL_Purchase_Order.Address as 'Address', TBL_Purchase_Order.Delivery_Term as 'Delivery Term' " & _
10                  
"FROM TBL_Purchase_Order " & _
11                  
"INNER JOIN TBL_Suppliers ON TBL_Purchase_Order.Supp_ID = TBL_Suppliers.Supp_ID " & _
12                  
"WHERE TBL_Purchase_Order.Approved = 'Yes' " & _
13                  
"AND TBL_Purchase_Order.Received_Date ='" & Format(dtreceived.Value, "MM/dd/yyyy") & "'"
14         
'"INNER JOIN TBL_Purchase_Detail ON TBL_Purchase_Order.Purchase_ID = TBL_Purchase_Detail.Purchase_ID) " & _
15
16         FillListView(ExecuteSQLQuery(sqlSTR), lstreceive,
0)
17         MDIREFRESH()
18         With MDIMain
19             .cmdNew.Enabled = False
20             .cmdEdit.Enabled = False
21             .cmdDelete.Enabled = False
22             
' .ToolStripNew.Enabled = False
23             
' .ToolStripEdit.Enabled = False
24             
' .ToolStripDelete.Enabled = False
25         End With
26         
'MsgBox(dtreceived.Value)
27     End Sub
28
29     Private Sub dtreceived_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dtreceived.ValueChanged
30         sqlSTR =
"SELECT TBL_Purchase_Order.Purchase_ID as 'ID',TBL_Suppliers.SuppName as 'Supplier Name'" & _
31                  
", TBL_Purchase_Order.Address as 'Address', TBL_Purchase_Order.Delivery_Term as 'Delivery Term'" & _
32                  
"FROM TBL_Purchase_Order " & _
33                  
"INNER JOIN TBL_Suppliers ON TBL_Purchase_Order.Supp_ID = TBL_Suppliers.Supp_ID " & _
34                  
"WHERE TBL_Purchase_Order.Approved = 'Yes' " & _
35                  
"AND TBL_Purchase_Order.Received_Date ='" & Format(dtreceived.Value, "MM/dd/yyyy") & "'"
36         
'"INNER JOIN TBL_Purchase_Detail ON TBL_Purchase_Order.Purchase_ID = TBL_Purchase_Detail.Purchase_ID) " & _
37         FillListView(ExecuteSQLQuery(sqlSTR), lstreceive,
0)
38     End Sub
39
40     Private Sub cmdcancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdcancel.Click
41         grpCat.Visible = False
42         Me.Enabled = True
43     End Sub
44
45     Private Sub CmdSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdSearch.Click
46         sqlSTR =
"SELECT DISTINCT TBL_Purchase_Order.Purchase_ID as 'ID',TBL_Suppliers.SuppName as 'Supplier Name'" & _
47                  
", TBL_Purchase_Order.Address as 'Address', TBL_Purchase_Order.Delivery_Term as 'Delivery Term'" & _
48                  
"FROM (TBL_Purchase_Order " & _
49                  
"INNER JOIN TBL_Purchase_Detail ON TBL_Purchase_Order.Purchase_ID = TBL_Purchase_Detail.Purchase_ID) " & _
50                  
"INNER JOIN TBL_Suppliers ON TBL_Purchase_Order.Supp_ID = TBL_Suppliers.Supp_ID " & _
51                  
"WHERE TBL_Purchase_Order.Approved = 'Yes' " & _
52                  
"AND TBL_Purchase_Order.Received_Date ='" & Format(dtreceived.Value, "MM/dd/yyyy") & "'" & _
53                  
" AND TBL_Suppliers.SuppName LIKE '%" & txtname.Text & "%'"
54         FillListView(ExecuteSQLQuery(sqlSTR), lstreceive,
0)
55         grpCat.Visible = False
56     End Sub
57 End Class


Gõ tìm kiếm nhanh...